package com.pair.micro.common.utils;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 分页工具类
 *
 * @author xubz
 */
@Data
@Schema(description = "分页数据")
@NoArgsConstructor
@AllArgsConstructor
public class PageResult<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "总记录数")
    private Long total;
    @Schema(description = "总记录数")
    private Long Pages;

    @Schema(description = "列表数据")
    private List<T> list;

    /**
     * 分页
     * @param list   列表数据
     * @param total  总记录数
     *  , Long pages
     */
    public PageResult(List<T> list,Long total) {
        this.total = total;
        //Pages = pages;
        this.list = list;
    }
}